package com.jindy.module.questions.service.impl;

import java.util.List;
import com.jindy.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jindy.module.questions.mapper.QuestionsMapper;
import com.jindy.module.questions.domain.Questions;
import com.jindy.module.questions.service.IQuestionsService;

/**
 * 机器故障题库Service业务层处理
 * 
 * @author jindy
 * @date 2023-03-21
 */
@Service
public class QuestionsServiceImpl implements IQuestionsService 
{
    @Autowired
    private QuestionsMapper questionsMapper;

    /**
     * 查询机器故障题库
     * 
     * @param id 机器故障题库主键
     * @return 机器故障题库
     */
    @Override
    public Questions selectQuestionsById(Long id)
    {
        return questionsMapper.selectQuestionsById(id);
    }

    /**
     * 查询机器故障题库列表
     * 
     * @param questions 机器故障题库
     * @return 机器故障题库
     */
    @Override
    public List<Questions> selectQuestionsList(Questions questions)
    {
        return questionsMapper.selectQuestionsList(questions);
    }

    /**
     * 查询机器故障题库列表
     *
     * @param questions 机器故障题库
     * @return 机器故障题库
     */
    @Override
    public List<Questions> selectQuestionsList2(Questions questions)
    {
        return questionsMapper.selectQuestionsList2(questions);
    }

    /**
     * 新增机器故障题库
     * 
     * @param questions 机器故障题库
     * @return 结果
     */
    @Override
    public int insertQuestions(Questions questions)
    {
        questions.setCreateTime(DateUtils.getNowDate());
        return questionsMapper.insertQuestions(questions);
    }

    /**
     * 修改机器故障题库
     * 
     * @param questions 机器故障题库
     * @return 结果
     */
    @Override
    public int updateQuestions(Questions questions)
    {
        questions.setUpdateTime(DateUtils.getNowDate());
        return questionsMapper.updateQuestions(questions);
    }

    /**
     * 批量删除机器故障题库
     * 
     * @param ids 需要删除的机器故障题库主键
     * @return 结果
     */
    @Override
    public int deleteQuestionsByIds(Long[] ids)
    {
        return questionsMapper.deleteQuestionsByIds(ids);
    }

    /**
     * 删除机器故障题库信息
     * 
     * @param id 机器故障题库主键
     * @return 结果
     */
    @Override
    public int deleteQuestionsById(Long id)
    {
        return questionsMapper.deleteQuestionsById(id);
    }
}
